Hello,
Object o = ...
if isEmtpy(o."Some Attribute") then
{
...
}
else
{
...
}
bool isEmpty(AttrRef )
. SystemAdmin - Wed Feb 23 06:44:33 EST 2011 |
Re: How to test if some attribute is set of not
Hello, Object o = current if (null o."Object Text" "") print "=>empty\n"; else print "=>no empty\n";
|
Re: How to test if some attribute is set of not SystemAdmin - Wed Feb 23 06:50:23 EST 2011
Hello, Object o = current if (null o."Object Text" "") print "=>empty\n"; else print "=>no empty\n";
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: How to test if some attribute is set of not Mathias Mamsch - Wed Feb 23 07:49:51 EST 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Yes. This should demo it:
string NameAttr = "MyEnumeratedAttr"
AttrDef ad = find(current Module, NameAttr)
Object oCurr = current
string ValuAttr = probeAttr_(oCurr, NameAttr)
print identifier(oCurr) "\t" NameAttr "\t"
if (null ad) print "No such attribute\n"
elseif(!ad.object) print "not definded for objects\n"
elseif(null ValueAttr) print "NotDefaultNorInherit\tnull\n"
elseif(!hasSpecificValue(oCurr, ad)
print "YesDefaultOrInherit\t" ValueAttr "\n"
else print "Has explicit value\t" ValueAttr "\n"
|
Re: How to test if some attribute is set of not Vincent |